#!/bin/bash

if [ $# -gt 0 ]; then
    SRCDIR=$*
else
    SRCDIR=.
fi

find ${SRCDIR} -name "*.h" -o -name "*.c" -o -name "*.hpp" -o -name "*.cpp" -o -name "*.cc" > cscope.files
ALL_FILES=$(cat cscope.files)
files=$(echo $ALL_FILES | wc -w)
lines=$(
cat $ALL_FILES |
grep -v -e "^$" |
grep -v -e "^\s*//" |
wc -l)

echo "$files files, $lines lines"
